package com.wejoy.video.middle.station.api.controller.app;

import com.wejoy.video.middle.station.api.controller.BaseController;
import com.wejoy.video.middle.station.data.domain.system.SysBaseParam;
import com.wejoy.video.middle.station.data.service.system.ISysBaseParamService;
import com.wejoy.video.middle.station.data.vo.RespJSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统--基础参数
 *
 * @author: admin
 * @time: 2022/9/22 22:03
 */
@RestController
@RequestMapping("/system/sysBaseParam")
public class SysBaseParamAction extends BaseController {

    @Autowired
    private ISysBaseParamService sysBaseParamService;

    /**
     * 主键查询
     *
     * @param uniCode uniCode
     * @return RespJSON
     */
    @RequestMapping("/getOneUniCode/{uniCode}")
    public RespJSON getOneUniCode(@PathVariable String uniCode) {
        SysBaseParam baseParamDB = sysBaseParamService.getOneByUniCode(uniCode);
        if (baseParamDB != null) {
            //不返回备注
            baseParamDB.setDescription(null);
        }
        return RespJSON.success(baseParamDB);
    }

}
